<template>
  <select @change="updateValue" class="mselect">
    <option v-for="option in options" :key="option.value" :value="option.value" :placeholder="placeholder">
      {{ option.text }}
    </option>
  </select>
</template>

<script>
export default {
  name: 'MSelect',
  props: {
    options: {
      type: Array,
      required: true,
    },
    selectvalue: {
      type: String,
      default: "0"
    },
    placeholder: {
      type: [String],
    },
  },
  setup(props, { emit }) {
    const updateValue = (event) => {
      emit('update:modelValue', event.target.value);
    };
    return {
      updateValue
    };
  }
};
</script>

<style scoped>
.mselect {
  height: 30px;
  border: 1px solid #d2d2d2;
  border-radius: 4px;
}
</style>
